package com.danco.training.zaneuskaya.connection.dao;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.Date;
import java.util.List;

import com.danco.training.zaneuskaya.domain.Book;
import com.danco.training.zaneuskaya.domain.Order;

public interface OrderDao extends GenericDao<Order, Integer> {

	public List<Order> readExecutedOrders(Connection connection);

	public List<Order> readNotExecutedOrders(Connection connection);

	public List<Order> readExecutedOrdersForPeriod(Connection connection,
			Date from, Date to);

	public List<Order> readOrdersSortedByOrderDate(Connection connection);

	public List<Order> readOrdersSortedByTotalPrice(Connection connection);

	public List<Order> readOrdersSortedByOrderState(Connection connection);

	public List<Order> readExecutedOrdersSortedByOrderDate(
			Connection connection, Date from, Date to);

	public List<Order> readExecutedOrdersSortedByPrice(Connection connection,
			Date from, Date to);

	public boolean addBookOrder(Connection connection, Order order, Book book);

	public boolean removeBookOrder(Connection connection, Order order, Book book);

	public boolean executeOrder(Connection connection, Integer id);
	
	public List<Order> findOrderByBook(Connection connection, Book book) ;
	
	public List<Book> findBooksByOrderId (Connection connection, Integer id );
	
	public boolean deleteOrderByBookFromOrderBook (Connection connection, Book book) ;
}
